package com.voicechat.firstmet.net.service;

import android.text.TextUtils;
import android.util.Log;

import com.voicechat.firstmet.bean.CharmBean;
import com.voicechat.firstmet.bean.CoummunityNotice;
import com.voicechat.firstmet.bean.FansAndLike;
import com.voicechat.firstmet.bean.GifBean;
import com.voicechat.firstmet.bean.GoldBean;
import com.voicechat.firstmet.bean.MySelfInfoBean;
import com.voicechat.firstmet.bean.PersonDataBean;
import com.voicechat.firstmet.bean.PhotoAlbumBean;
import com.voicechat.firstmet.bean.PostBean;
import com.voicechat.firstmet.bean.RecordListBean;
import com.voicechat.firstmet.bean.Result;
import com.voicechat.firstmet.bean.VoiceChatBean;
import com.voicechat.firstmet.net.Params;
import com.voicechat.firstmet.realm.GiftDataBean;

import rx.Observable;

/**
 * @ProjectName: FirstMet
 * @Package: com.voicechat.firstmet.net.service
 * @ClassName: MeInfoService
 * @Description: 我的相关service
 * @Author: ljp
 * @CreateDate: 2018/10/22 15:50
 * @Version: 1.0
 */
public class MeInfoService extends BaseService {
    private static String TAG = "MeInfoService";
    /**
     * 通道
     */
    public interface AISLE_TYPE {
        String AISLE_TYPE_1 = "1";//微信
        String AISLE_TYPE_2 = "2";//支付宝
    }
    /**
     * @method
     * @description 我的关注
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<FansAndLike> myLikeList(String token, String equipmentId,String userId,String pageNo) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("pageNo", pageNo);
        params.put("pageSize", 10);//一页返回多少条数据 默认10
        Log.i(TAG, "myLikeList: ----------"+params);
        return sNetInterface.myLikeList(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description 我的粉丝
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<FansAndLike> myFansList(String token, String equipmentId, String userId,String pageNo) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("pageNo", pageNo);
        params.put("pageSize", 10);//一页返回多少条数据 默认10
        return sNetInterface.myFansList(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description 取消关注、关注
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<Result> likeAndUnLike(String token, String equipmentId, String userId,String anchorId) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("anchorId", anchorId);
        Log.i(TAG, "likeAndUnLike: ----"+params);
        return sNetInterface.likeAndUnLike(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description  显示粉丝、关注、访客、点赞、土豪值、魅力值、关注状态
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<CharmBean> showState(String token, String equipmentId, String userId,String anchorId) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("anchorId", anchorId);
        //Log.i(TAG, "likeAndUnLike: ----"+params);
        return sNetInterface.showState(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 判断是否填写资料
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<MySelfInfoBean> selectUserData(String mobile,String token,String equipmentId) {
        Params params = new Params();
        params.put("mobile", mobile);
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        Log.i("LoginService", "" + params.toString());
        return sNetInterface.selectUserData(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description  显示谁看过我相关信息
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<CharmBean> showLook(String token, String equipmentId, String userId) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        Log.i(TAG, "likeAndUnLike: ----"+params);
        return sNetInterface.showLook(params).compose(applySchedulers());
    }
    /*
     * @return
     * @method
     * @description 修改资料
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<MySelfInfoBean> updateData(Params params) {
        Log.i("LoginService", "" + params.toString());
        return sNetInterface.addData(params).compose(applySchedulers());
    }

    /**
     * @method
     * @description  我看过谁
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<FansAndLike> lookMe(String token, String equipmentId,String userId,String page) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("pageNo", page);
        params.put("pageSize", "10");//一页返回多少条数据 默认10
        //Log.i(TAG, "likeAndUnLike: ----"+params);
        return sNetInterface.lookMe(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description  谁看过我
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<FansAndLike> meLook(String token, String equipmentId,String userId,String page) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("pageNo", page);
        params.put("pageSize", "10");//一页返回多少条数据 默认10
        //Log.i(TAG, "likeAndUnLike: ----"+params);
        return sNetInterface.meLook(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description  他人动态 我的动态
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<PostBean> dynamicPage(String token, String equipmentId, String userId, String anchorId, String page,String pageSize) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("anchorId", anchorId);
        params.put("pageNo", page);
        params.put("pageSize", pageSize);//一页返回多少条数据 默认10
        //Log.i(TAG, "likeAndUnLike: ----"+params);
        return sNetInterface.dynamicPage(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description  请求会员信息
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<MySelfInfoBean> queryVipData(String token, String equipmentId, String userId) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        //Log.i(TAG, "likeAndUnLike: ----"+params);
        return sNetInterface.queryVipData(params).compose(applySchedulers());
    }

    /**
     * @return
     * @method
     * @description 提交经纬度
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<MySelfInfoBean> updateLongitude(String userId,String token,String equipmentId,double longitude,double dimension ) {
        Params params = new Params();
        params.put("userId", userId);
        params.put("token", token);
        params.put("longitude",longitude);//经度
        params.put("dimension",dimension);//纬度
        params.put("equipmentId",equipmentId);
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.addData(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 实名认证
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> realName(String userId,String token,String equipmentId,
                                              String idCard,String mobile,String code,
                                              String positiveUrl,String negativeUrl,String name) {
        Params params = new Params();
        params.put("userId", userId);
        params.put("token", token);
        params.put("name",name);
        params.put("idCard",idCard);//身份证
        params.put("mobile",mobile);//手机
        params.put("positiveUrl",positiveUrl);//证件照正面
        params.put("negativeUrl",negativeUrl);//证件照反面
        params.put("code",code);//短信验证码
        params.put("equipmentId",equipmentId);
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.realName(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 实名认证信息查询
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<PersonDataBean> certificationSelect(String userId, String token, String equipmentId) {
        Params params = new Params();
        params.put("userId", userId);
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.certificationSelect(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 客服与帮助
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> serviceAndHelp(String userId, String token, String equipmentId,
                                                    String content,String contact) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("content", content);//内容
        params.put("contact",contact);//联系方式
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.serviceAndHelp(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 举报投诉
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> reportAndComplain(String userId, String token, String equipmentId,
                                                    String content,String reportedId,String type) {
        Params params = new Params();
        params.put("reporterId", userId);//举报人id
        params.put("reportedId", reportedId);//被举报人id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("type",  type);//举报类型，1举报 2投诉
        params.put("content",content);//举报内容
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.reportAndComplain(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 消费记录
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<RecordListBean> consumeList(String userId, String token, String equipmentId,
                                                       String page) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo", page);
        params.put("pageSize", "30");//一页返回多少条数据 默认10
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.consumeList(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 礼物记录
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<GifBean> gifList(String userId, String token, String equipmentId,
                                              String page) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo", page);
        params.put("pageSize", "30");//一页返回多少条数据 默认10
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.diamondList(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 提现记录
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<RecordListBean> withdrawList(String userId, String token, String equipmentId,
                                             String page) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo", page);
        params.put("pageSize", "30");//一页返回多少条数据 默认10
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.withdrawList(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 收入记录
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<RecordListBean> incomeList(String userId, String token, String equipmentId,
                                                  String page) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo", page);
        params.put("pageSize", "30");//一页返回多少条数据 默认10
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.incomeList(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 充值记录
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<RecordListBean> rechargeList(String userId, String token, String equipmentId,
                                                          String page) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo", page);
        params.put("pageSize", "30");//一页返回多少条数据 默认10
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.rechargeList(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 购买记录
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<RecordListBean> buyVipList(String userId, String token, String equipmentId,
                                                          String page) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo", page);
        params.put("pageSize", "30");//一页返回多少条数据 默认10
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.buyVipList(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 金币钻石
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<GoldBean> goldDiamond(String userId, String token, String equipmentId
                                                   ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.goldDiamond(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 热门搜索数据
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<PhotoAlbumBean> hotSearch(String userId, String token, String equipmentId
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        //Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.hotSearch(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 搜索用户
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<FansAndLike> searchUser(String userId, String token, String equipmentId,
                                                     String search,String page
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("search", search);//搜索条件
        params.put("pageNo",page);
        params.put("pageSize", "10");
        Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.searchUser(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 搜索帖子
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<PostBean> searchPost(String userId, String token, String equipmentId,String search,String page
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("search", search);//搜索条件
        params.put("pageNo",page);
        params.put("pageSize", "10");
        //Log.i("LoginService", "" +sNetInterface.toString()+ params.toString());
        return sNetInterface.searchPost(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 系统消息
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<CoummunityNotice> systemMessage(String userId, String token, String equipmentId, String page,String sign
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        if(sign.equals("1")){
            params.put("sign", "1");
        }else {
            params.put("pageNo",page);
            params.put("pageSize", "10");
        }
        Log.i("LoginService", "" + params.toString());
        return sNetInterface.systemMessage(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 好友申请
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<CoummunityNotice> friendAccept(String userId, String token, String equipmentId, int page
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo",page);
        params.put("pageSize", 10);
        Log.i("LoginService", "" + params.toString());
        return sNetInterface.friendAccept(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 官方通知
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<CoummunityNotice> officialMessage(String userId, String token, String equipmentId, String page
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo",page);
        params.put("pageSize", "10");
        Log.i("LoginService", "" + params.toString());
        return sNetInterface.officialMessage(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description vip特权
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> setVipRight(Params params
    ) {
        Log.i("LoginService", "" + params.toString());
        return sNetInterface.setVipRight(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 我的任务
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<CharmBean> selectNewTask(String userId, String token, String equipmentId
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("type","0");
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.selectNewTask(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 领取奖励
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> receiveAward(String userId, String token, String equipmentId,String objectId,String gold,String type
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("objectId", objectId);//任务id
        params.put("gold", gold);//任务id
        params.put("type",type);

        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.receiveAward(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 上传照片
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> uploadingPicture(String userId, String token, String equipmentId,String albumUrl
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("albumUrl", albumUrl);//照片地址
        //Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.uploadingPicture(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 发送帖子
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> sendPost(String userId, String token, String equipmentId,String url,
                                              String title, String content,String warrant,String voiceUrl,String duration
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        if (!TextUtils.isEmpty(url)){
            params.put("url", url);//照片地址
            params.put("type", "1");// 类型 0 纯文字 1 图文 2 语音
        }else if (!TextUtils.isEmpty(voiceUrl)){
            params.put("voiceUrl", voiceUrl);//照片地址
            params.put("duration",duration);
            params.put("type", "2");// 类型 0 纯文字 1 图文 2 语音
        }else {
            params.put("type", "0");// 类型 0 纯文字 1 图文 2 语音
        }
        params.put("title",title);
        params.put("content", content);
        params.put("warrant", warrant);//授权评论 1默认 2不允许评论
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.sendPost(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 提现账号查询
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<MySelfInfoBean> queryAccount(String userId, String token, String equipmentId
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("aisle",AISLE_TYPE.AISLE_TYPE_2);// 通道
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.queryAccount(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 提现账号查询
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> submitAccount(String userId, String token, String equipmentId,String account,String name
    ) {
        Params params = new Params();
        params.put("accountId", userId);//账号id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("account",account);
        params.put("name",name);
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.submitAccount(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 下载礼物数据
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<GiftDataBean> uplodingGif(String userId, String token, String equipmentId
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.uplodingGif(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 判断版本更新
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<GiftDataBean> uplodingVersion(String userId, String token, String equipmentId,String channel,String type) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("channel", channel);
        params.put("type",type);//type                类型  1安卓  2 iOS 3礼物
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.uplodingVersion(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 赠送礼物
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> sendGift(String userId, String token, String equipmentId,
                                            String presentationId, String giftId, String gold,
                                              String type,String objectId,String number,String flag
    ) {
        Params params = new Params();
        params.put("userId", userId);//用户id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("presentationId",presentationId);// 接收者id
        params.put("giftId",giftId);//礼物id
        params.put("gold",gold);//礼物金币数量
        params.put("type",type);//消费类型 1语聊 2打赏 3送礼
        if(flag.equals("post")){
            params.put("objectId",objectId);//帖子id
        }
        params.put("number",number);//礼物数量
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.sendGift(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 判断对方是否接听
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<VoiceChatBean> voiceChatJude(String userId, String token, String equipmentId, String callingId
    ) {
        Params params = new Params();
        params.put("calledId", userId);//被叫方id
        params.put("callingId", callingId);//主叫方id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.voiceChatJude(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 创建房间成功后请求服务器
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> rommSuccess(String userId, String token, String equipmentId, String callingId,String roomId
    ) {
        Params params = new Params();
        params.put("calledId", userId);//被叫方id
        params.put("callingId", callingId);//主叫方id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("roomId",roomId);
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.rommSuccess(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * 接听请求(进入房间成功或失败)
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> voiceAnswer(String userId, String token, String equipmentId, String callingId,String roomSign
    ) {
        Params params = new Params();
        params.put("calledId", userId);//被叫方id
        params.put("callingId", callingId);//主叫方id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("roomSign",roomSign);//进入房间标识  0成功 1失败
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.voiceAnswer(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * 退出房间请求
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> exitVoiceChat(String userId, String token, String equipmentId, String callingId,
                                                   String sign,String tag
    ) {
        Params params = new Params();
        params.put("calledId", userId);//被叫方id
        params.put("callingId", callingId);//主叫方id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("sign",sign);//挂断标记  0呼叫方 1接听方
        params.put("tag",tag);//0挂断 1正常退出
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.exitVoiceChat(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * 提现
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> setWithdraw(String userId, String token, String equipmentId, String account,
                                                   String rmb,String gold,String aisle,String code
    ) {
        Params params = new Params();
        params.put("userId", userId);//自己的id
        params.put("account", account);//支付宝账户
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("rmb",rmb);//金额
        params.put("gold",gold);//钻石
        params.put("code",code);//验证码
        params.put("aisle",aisle);//通道标记
        Log.i("LoginService", "selectNewTask" + params.toString());
        return sNetInterface.setWithdraw(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 聊天发送礼物，搭讪，
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> sendGiftChat(String userId, String token, String equipmentId,
                                              String fanId, String giftId, String gold,
                                              String type,String number
    ) {
        Params params = new Params();
        params.put("anchorId", userId);//发送者id
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("fanId",fanId);// 接收者id
        params.put("giftId",giftId);//礼物id
        //params.put("gold",gold);//礼物金币数量
        params.put("type",type);//消费类型 4礼物 6搭讪
        params.put("giftNumber",number);//礼物数量
        Log.i("LoginService", "sendGiftChat" + params.toString());
        return sNetInterface.sendGiftChat(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 查询聊天页面公告
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<CoummunityNotice>  queryVoiceNotice(String token, String equipmentId
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        //params.put("gold",gold);//礼物金币数量
        params.put("type","1");//类型  0首页滚动 1语聊滚动
        Log.i("LoginService", "sendGiftChat" + params.toString());
        return sNetInterface.communityNotice(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 语聊评价标签
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<PhotoAlbumBean>  voiceAppraise(String token, String equipmentId
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("pageNo","1");
        params.put("pageSize", "30");
        Log.i("LoginService", "sendGiftChat" + params.toString());
        return sNetInterface.voiceAppraise(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 回复搭讪消息
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result>  sendReplyMessage(String token, String equipmentId,String userId, String presentationId
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("userId", userId);//自己的id
        params.put("presentationId", presentationId);//对方的id
        Log.i("LoginService", "sendGiftChat" + params.toString());
        return sNetInterface.sendReplyMessage(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 语聊介绍付费方收到信息
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<MySelfInfoBean>  voiceEndData(String token, String equipmentId,String userId, String voiceId
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        //params.put("userId", userId);//自己的id
        params.put("voiceId", voiceId);//语聊id
        Log.i("LoginService", "sendGiftChat" + params.toString());
        return sNetInterface.voiceEndData(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 保存语聊评价
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result>  saveVoiceData(String token, String equipmentId, String voiceId,String star,String tagNames
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("star", star);//自己的id
        params.put("voiceId", voiceId);//语聊id
        params.put("tagNames", tagNames);//语聊id
        Log.i("LoginService", "sendGiftChat" + params.toString());
        return sNetInterface.saveVoiceData(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description  修改系统消息标记
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result>  setMsgRead(String token, String equipmentId,String userId
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("userId", userId);//语聊id
        Log.i("LoginService", "setMsgRead" + params.toString());
        return sNetInterface.setMsgRead(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description  修改好友申请消息标记
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result>  setMsgReadFriends(String token, String equipmentId,String userId
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("userId", userId);//语聊id
        Log.i("LoginService", "setMsgRead" + params.toString());
        return sNetInterface.setMsgReadFriends(params).compose(applySchedulers());
    }

    /**
     * @return
     * @method
     * @description  修改系统消息标记
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result>  deletePhoto(String token, String equipmentId,String albumId
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("albumId", albumId);//图片id
        //Log.i("LoginService", "setMsgRead" + params.toString());
        return sNetInterface.deletePhoto(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description  添加隐友
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result>  addFriends(String token, String equipmentId,String userId,String friendId
    ) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId",equipmentId);
        params.put("friendId", friendId);//被添加人id
        params.put("userId", userId);//自己id
        //Log.i("LoginService", "setMsgRead" + params.toString());
        return sNetInterface.addFriends(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description 我的隐友列表
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<FansAndLike> myFriendsList(String token, String equipmentId, String userId,String pageNo) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("pageNo", pageNo);
        params.put("pageSize", 10);//一页返回多少条数据 默认10
        return sNetInterface.myFriendsList(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description 同意好友请求
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<Result> acceptAddFriends(String token, String equipmentId, String userId, String friendId,int sign) {
        Params params = new Params();
        params.put("token", token);
        params.put("sign",sign);//0未处理(默认) 1同意 2拒绝
        params.put("equipmentId", equipmentId);
        params.put("userId", userId);
        params.put("friendId", friendId);
        return sNetInterface.acceptAddFriends(params).compose(applySchedulers());
    }


}
